Skip to content

Conversation

robertky
Copy link
Member

Summary

Closes #38.

Adds a separate Favorites view where saved books remain available together, even when they were added from different subjects or after the page has been reloaded.

Changes

  • Adds Library and Favorites view controls in src/App.tsx, with clear selected and keyboard-focus states
  • Stores the small amount of book information needed by the overview in t19.favorites, rather than only storing a book key
  • Keeps existing saved keys compatible: a legacy favorite is retained and filled with details when its book is shown again
  • Keeps corrupt or unavailable localStorage safe by falling back to an empty favorites list
  • Replaces the old subject-specific favorites section with src/components/FavoritesView.tsx, which shows all saved books together and orders them by title
  • Keeps saving, removing, subject filtering, sorting, navigation, and the existing OpenLibrary request flow working without additional API calls

User flow covered

  1. Save a book from one subject.
  2. Change subject and save another book.
  3. Open Favorites to see both books in one overview.
  4. Reload the page and return to Favorites; both books remain available.
  5. Remove a saved book directly from the overview.

Tests

  • Updates favorite persistence tests to verify the stored book details
  • Covers legacy key-only favorites, corrupt stored data, and favorites from different subjects after reload
  • Covers switching between Library and Favorites views
  • Covers alphabetical ordering in the favorites overview
  • Deliberately updates the App snapshot for the new view controls and removal of the old inline favorites section

Validation

  • npm run format:check
  • npm run lint
  • npm test — 62 tests passed
  • npm run build

Checklist

  • Favorites are collected independently of the active subject
  • Favorite data remains local and does not create extra OpenLibrary requests
  • Existing stored favorites remain usable
  • The separate view works with keyboard focus and has an explicit selected state

@robertky robertky requested a review from a team as a code owner September 17, 2026 09:15
@robertky robertky added the type: feature New functionality or requirement label Sep 17, 2026
@robertky robertky added this to the M4 — Quality milestone Sep 17, 2026
@robertky robertky added area: ui React components, presentation, navigation priority: high Required for first delivery status: in-review PR is open and awaiting review ai-assisted Substantial AI-generated code (documented per spec) labels Sep 17, 2026
Copy link
Member

@rachelks rachelks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One small responsive UI thing I noticed when testing: on narrow screens, I think the Library and Favorites buttons would work better stacked vertically instead of side by side

@rachelks rachelks merged commit ec38684 into main Sep 17, 2026
1 check passed
Sign in to join this conversation on GitHub.
Labels
ai-assisted Substantial AI-generated code (documented per spec) area: ui React components, presentation, navigation priority: high Required for first delivery status: in-review PR is open and awaiting review type: feature New functionality or requirement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add a separate favorites view with cross-subject overview
2 participants